#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "InteractionFragment.h"
#include "NamedElement.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class OccurrenceSpecification;

/// <summary>
/// ExecutionSpecification
/// An ExecutionSpecification is a specification of the execution of a unit of
/// Behavior or Action within the Lifeline. The duration of an
/// ExecutionSpecification is represented by two OccurrenceSpecifications, the start
/// OccurrenceSpecification and the finish OccurrenceSpecification.
/// </summary>
class UMLMODEL_EXPORT ExecutionSpecification : public NamedElement, public InteractionFragment {

public: // Constructors and destructors
    explicit ExecutionSpecification(const QString& umlType="uml::ExecutionSpecification");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// finish getter
    /// References the OccurrenceSpecification that designates the finish of the Action
    /// or Behavior.
    /// </summary>
    shared_ptr<OccurrenceSpecification> finish() const;

    /// <summary>
    /// finish setter
    /// References the OccurrenceSpecification that designates the finish of the Action
    /// or Behavior.
    /// </summary>
    void setFinish(shared_ptr<OccurrenceSpecification> value);

    /// <summary>
    /// start getter
    /// References the OccurrenceSpecification that designates the start of the Action
    /// or Behavior.
    /// </summary>
    shared_ptr<OccurrenceSpecification> start() const;

    /// <summary>
    /// start setter
    /// References the OccurrenceSpecification that designates the start of the Action
    /// or Behavior.
    /// </summary>
    void setStart(shared_ptr<OccurrenceSpecification> value);

private: // Fields
    /// <summary>
    /// finish
    /// References the OccurrenceSpecification that designates the finish of the Action
    /// or Behavior.
    /// </summary>
    shared_ptr<OccurrenceSpecification> finish_;

    /// <summary>
    /// start
    /// References the OccurrenceSpecification that designates the start of the Action
    /// or Behavior.
    /// </summary>
    shared_ptr<OccurrenceSpecification> start_;

};

} // namespace uml
